package scene.accel.bsp;

import java.util.List;

import rasterization.Rasterizer;
import scene.shape.geometry.Triangle;
import util.Vector3f;

public class BSPTree {
	
	BSPNode treeRoot;
	
	public BSPTree(List<Triangle> T){
		if(T.isEmpty())
			treeRoot = null;
		else{
			treeRoot = new BSPNode(T.get(0));
			for(int i = 1; i < T.size(); i++){
				treeRoot.add(T.get(i));
			}
		}
	}
	
	public void draw(Vector3f e, Rasterizer r){
		if(treeRoot == null)
			return;
		treeRoot.draw(e,r);
	}
}
